/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package terminal.ui.contexts;

import kret.ui.AbstractFrameContext;
import kret.io.FileUtils;
import kret.ui.ActionManager;
import terminal.ui.forms.DialogAbout;

/**
 *
 * @author prpo4526
 */
public class DialogAboutContext extends AbstractFrameContext
{
    public DialogAboutContext( ActionManager actionManager, DialogAbout frame )
    {
        super( actionManager, frame );
        
        getCommandAdapter().bindToCommand( frame.getTriggerClose(), COMMAND_DIALOG_ABOUT_CLOSE );
        
        if ( null != frame )
        {
            frame.getTextPaneAbout().setContentType( "text/html" );                
            frame.getTextPaneAbout().setText( FileUtils.resourceToString( "terminal/ui/resources/documents/About.html", "UTF-8") );                
            //frame.getTextPaneAbout().setText( "<B>DDDUPA!!!" ) ;
        }
    }
    
    @Override public void onFrameClosed()
    {
        
    }
    
    @Override public void onFrameOpened()
    {
        
    }
    
    @Override public void onFrameActivated()
    {
     
    }    
    
    @Override public void onCommandExecuted( final String command )
    {
        if ( null != command )
        {
            switch ( command )
            {                   
                case COMMAND_DIALOG_ABOUT_CLOSE:
                {
                    closeFrame();
                }
                break;
            }            
        } 
    }    
}
